- Task (T): Deciding if an email is spam or not
- Experience (E): Looking at thousands of emails labeled "spam" or "not spam"
- Performance (P): Accuracy — how often the classifier gets the right answer
Welcome to Introduction to Machine Learning . This unit provides an overview of the main concepts and topics that we will study in this course. We begin by defining machine learning and understanding how it differs from traditional rule-based problem solving. We then look at the major types of machine learning problems, including supervised and unsupervised learning. The unit also introduces the distinction between classification and regression, the curse of dimensionality, and the main steps involved in a machine learning project. These concepts provide the foundation for the algorithms and techniques covered in the later units.
There are several definitions of machine learning, but two well-known definitions are given by Arthur Samuel and Tom Mitchell:
"Machine learning is the field of study that gives computers the ability to learn
without being explicitly programmed." — Arthur Samuel (1959)
"A computer program is said to learn from experience E with respect to some
class of tasks T and performance measures P, if its performance at tasks
in T, as measured by P, improves with experience E." — Tom Mitchell (1988)
Together, these definitions highlight an important idea: a machine learning system improves its performance by learning from experience or data rather than relying only on rules explicitly written by a programmer.
Humans make decisions in two primary ways:
Supervised machine learning is closer to this second approach. Instead of manually writing rules for every possible situation, we provide the system with previous examples and allow it to learn a model from those examples. We can think of this process in three simple stages: Remember — Formulate — Predict framework:
Machine learning problems are commonly divided into three major paradigms: supervised learning, unsupervised learning, and reinforcement learning. The main difference between them is how the learning system receives information and feedback.
Once we focus on supervised learning, another important distinction is needed. Supervised learning problems can be divided into classification and regression based on the type of output that the model needs to predict.
| Aspect | Classification | Regression |
|---|---|---|
| Output Type | Discrete / Categorical (classes) | Continuous / Numerical (values) |
| Example Outputs | Yes/No, Cat/Dog/Bird, Disease/Healthy | $245,000, 72.3 °F, 3.8 GPA |
| Mathematical Goal | Find decision boundary | Minimize prediction error \( \sum (y - \hat{y})^2 \) |
| Classification | Regression |
|---|---|
| Will it rain tomorrow? (Yes/No) | How much rain will fall? (2.3 inches) |
| Is this email spam? (Spam/Ham) | What's the spam probability? (0.73) |
| Which genre is this movie? (Action/Comedy/Drama) | What rating will this movie get? (7.2/10) |
| Will customer buy? (Buy/Not Buy) | How much will customer spend? ($127.50) |
Machine learning datasets can contain a large number of features. When the number of features becomes very large, we face what is known as the curse of dimensionality . The high-dimensional data (hundreds or thousands of features) creates two critical problems:
One way to address these problems is dimensionality reduction . The basic idea is to keep the most useful information while reducing unnecessary or redundant features. This can also make the data easier to visualize, process, and analyze. Throughout this course, we will explore various dimensionality reduction techniques, including Principal Component Analysis (PCA) and feature selection methods.
Learning individual machine learning algorithms is only one part of building a machine learning system. In practice, a machine learning project involves several steps, starting from collecting the raw data and ending with deploying and monitoring the final model. These steps are connected. Decisions made during data preparation affect model development, and mistakes made early in the process can lead to misleading evaluation results. For this reason, it is important to follow a proper workflow rather than treating model training as an isolated step. Every real-world ML project follows a structured 9-step lifecycle. Skipping or misordering steps is a common source of project failure.
Step 1: Raw Data Collection
Gathering data from various sources—databases, APIs, sensors, user interactions, etc. This raw data may come in different formats and may require integration from multiple sources.
Step 2: Initial Dataset Creation (Rows × Columns)
Organizing the collected data into a structured format where each row represents an example (instance) and each column represents a feature (attribute). At this stage, we have the basic dataset but haven't processed it further.
Step 3: Preprocessing Pipeline 1 – Data Cleaning (Performed on the Full Dataset)
Before we split the data, we fix universal data integrity issues. Because these operations correct formatting, structure, or obvious errors without using statistical properties of the target variable, they are safely applied to the entire dataset:
Step 4: Data Splitting (Train / Validation / Test)
Dividing the dataset into separate subsets. A common high-level split is 80% for training and 20% for testing. However, to support the model development loop in Step 6, we further split the training portion to carve out a validation set (or use cross‑validation techniques).
Step 5: Preprocessing Pipeline 2 – Advanced (Strictly Train-Only)
Any operation that learns statistical properties from the data must be performed here, after the split:
Step 6: Model Development Loop
Using the validation set (derived from the training split in Step 4) to iteratively improve the model without ever peeking at the final test set:
Step 7: Final Model Training (Full Train Set)
After finding the best hyperparameters through the development loop, train the final model using the entire training set (including any validation data) with those optimal parameters.
Step 8: Test Set Evaluation
The test set, which has been completely untouched throughout the entire development process, is now used for the final evaluation. This provides the true estimate of how well the model will generalize to new, unseen data.
Step 9: Production Deployment & Monitoring
Deploying the model to a production environment where it can make predictions on real-world data, while continuously monitoring its performance and watching for drift or degradation over time.
The separation between the two preprocessing stages and the train/test split is particularly important. Basic data cleaning is performed before the split, while operations that learn parameters from the data, such as scaling and PCA, are handled after the split.
The topics in this course are organized around the main types of machine learning problems and the techniques used to solve them. We begin with classification and related concepts, then move to regression, clustering, dimensionality reduction, and neural networks. The roadmap shows where these topics appear during the course and how they relate to the broader machine learning workflow.
| Category | Topics | Weeks |
|---|---|---|
| Classification | k-NN, Decision Trees, Naïve Bayes, Logistic Regression, Random Forest, AdaBoost, Stacking | 2, 5–7, 11 |
| Regression | OLS, Lasso/Ridge/Elastic Net, Regression Tree, kNN Regressor, Gradient Boosting | 8–10 |
| Clustering | Agglomerative, K-Means, DBSCAN | 12–14 |
| Dimensionality Reduction | PCA, Filter/Wrapper Feature Selection, RFE, Step-wise, Autoencoders | 2–3, 9, 12 |
| Neural Networks | ANN with Backpropagation | 11–12 |
For each scenario below, classify whether it is a Classification or Regression problem. Click the button to reveal the answer.
Scenario A: An e-commerce platform wants to predict the exact dollar amount a visitor will spend on their next visit.
Scenario B: A bank wants to flag credit card transactions as genuine or fraudulent.
Scenario C: A streaming service wants to predict the viewer rating (1–5 stars) for a new show. Hint: Is 4.2 a valid prediction?
Using the dropdowns, place the 9 lifecycle steps in the correct order. Then click Check Order to see how you did.
Step 1:
Step 4:
Step 5: (Applied to which dataset only?)
Step 8:
For each of the following five tasks, determine (i) the ML paradigm (Supervised / Unsupervised / Reinforcement), and (ii) the sub-type (Classification / Regression / Clustering / N/A).
| # | Scenario | Paradigm | Sub-type | Reasoning |
|---|---|---|---|---|
| 1 | Netflix user segmentation | Unsupervised | Clustering | No pre-existing segment labels; discovering natural groups |
| 2 | Astronomical image labeling | Supervised | Classification | Uses a labeled catalog with 4 discrete classes |
| 3 | Wheat yield prediction | Supervised | Regression | Predicts continuous bushels-per-acre value |
| 4 | Self-driving simulation | Reinforcement | N/A | Agent learns via reward signals from environment (not from labeled data) |
| 5 | Job-offer acceptance prediction | Supervised | Classification | Binary outcome (accept/decline) trained on historical labeled records |
A hospital is building a model to readmit or not readmit patients within 30 days of discharge. It uses 50,000 historical records with known readmission outcomes. The model is judged on its overall percentage of correct predictions on a held-out validation set.
Step 1: Identify the Task (T).
The model must make a binary decision for each patient: Classify whether the patient will be readmitted within 30 days or not.
Step 2: Identify the Experience (E).
The training corpus: 50,000 historical patient records with known readmission outcomes (labels).
Step 3: Identify the Performance measure (P).
Accuracy = \( \frac{\text{# correct predictions}}{\text{# total predictions}} \) on a held-out validation set, expressed as a percentage.
Sanity check: As the model studies more labeled records (E increases), its accuracy (P) on the classification task (T) should improve. ✓
A dataset has 2,500 labeled samples. We use an 80/20 train/test split.
Step 1: Compute training-set size.
Step 2: Compute test-set size.
Step 3: Key rule — which set should be used for each purpose?
For each scenario, write down your answers (Paradigm + Sub-type + 1-sentence reasoning) and then check against the solution.
A dataset has 8,400 labeled samples and uses a 75/25 train/test split.
A rideshare company builds a model to predict passenger cancellation (Yes / No) for a booked ride. It has 120,000 past bookings with cancellation labels. Performance is measured as the fraction of rides whose cancellation outcome is correctly predicted.
Identify T (Task), E (Experience), and P (Performance measure).
Answer all 5 MCQs. Click on an option to get instant feedback.
Your score: 0 / 5